import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/login',
            redirect: '/customer'
        },
        {
            path: '/',
            component: () => import('../components/common/Home.vue'),
            meta: { title: '销售信息系统' },
            children: [
                {
                    path: '/customer',
                    component: () => import( '../components/page/customer.vue'),
                    meta: { title: '顾客信息' }
                },
                {
                    path: '/goods',
                    component: () => import('../components/page/goods.vue'),
                    meta: { title: '商品信息' }
                },
                {
                    path:'/orders',
                    component: () => import('../components/page/orders.vue'),
                    meta: {title:'订单详情'}
                },
                {
                    path:'/details',
                    component:() => import('../components/page/details.vue'),
                    meta:{title: '订单细则'}
                },
                {
                   path:'/vendor',
                   component:() =>import('../components/page/vendor.vue'),
                   meta:{title: '工厂信息'}
                },
                {
                    path: '/404',
                    component: () => import( '../components/page/404.vue'),
                    meta: { title: '404' }
                },
                {
                    path: '/403',
                    component: () => import( '../components/page/403.vue'),
                    meta: { title: '403' }
                },
            ]
        },
        {
            path: '/login',
            component: () => import( '../components/page/Login.vue'),
            meta: { title: '登录' }
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
});
